import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'RouterSecondPage.dart';


class RouterPage extends StatelessWidget {
  final SystemUiOverlayStyle _style = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(_style);
    // TODO: implement build
    return MaterialApp(
      home: RouterStatefulWidget(),
      theme: ThemeData(primarySwatch: Colors.yellow),
    );
  }
}

class RouterStatefulWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _RouterState();
  }
}

class _RouterState extends State<StatefulWidget> {

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title:Text("Material Page Route"),
      ),
      body:  Center(
        child: FlatButton(onPressed: (){
          Navigator.push(context, MaterialPageRoute(builder: (context) => RouterSecondPage()));
        }, child: Text("跳转")),
      ),
    );
  }
}